package com.ruoyi.hospital.service.doctor.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.doctor.DocMemberGroupMapper;
import com.ruoyi.hospital.domain.doctor.DocMemberGroup;
import com.ruoyi.hospital.service.doctor.IDocMemberGroupService;

/**
 * 患者分组Service业务层处理
 * 
 * @author wendao
 * @date 2024-10-09
 */
@Service
public class DocMemberGroupServiceImpl implements IDocMemberGroupService 
{
    @Autowired
    private DocMemberGroupMapper docMemberGroupMapper;

    /**
     * 查询患者分组
     * 
     * @param id 患者分组主键
     * @return 患者分组
     */
    @Override
    public DocMemberGroup selectDocMemberGroupById(Integer id)
    {
        return docMemberGroupMapper.selectDocMemberGroupById(id);
    }

    /**
     * 查询患者分组列表
     * 
     * @param docMemberGroup 患者分组
     * @return 患者分组
     */
    @Override
    public List<DocMemberGroup> selectDocMemberGroupList(DocMemberGroup docMemberGroup)
    {
        return docMemberGroupMapper.selectDocMemberGroupList(docMemberGroup);
    }

    /**
     * 新增患者分组
     * 
     * @param docMemberGroup 患者分组
     * @return 结果
     */
    @Override
    public int insertDocMemberGroup(DocMemberGroup docMemberGroup)
    {
        docMemberGroup.setCreateTime(DateUtils.getNowTimeSecond());
        return docMemberGroupMapper.insertDocMemberGroup(docMemberGroup);
    }

    /**
     * 修改患者分组
     * 
     * @param docMemberGroup 患者分组
     * @return 结果
     */
    @Override
    public int updateDocMemberGroup(DocMemberGroup docMemberGroup)
    {
        docMemberGroup.setUpdateTime(DateUtils.getNowTimeSecond());
        return docMemberGroupMapper.updateDocMemberGroup(docMemberGroup);
    }

    /**
     * 批量删除患者分组
     * 
     * @param ids 需要删除的患者分组主键
     * @return 结果
     */
    @Override
    public int deleteDocMemberGroupByIds(Integer[] ids)
    {
        return docMemberGroupMapper.deleteDocMemberGroupByIds(ids);
    }

    /**
     * 删除患者分组信息
     * 
     * @param id 患者分组主键
     * @return 结果
     */
    @Override
    public int deleteDocMemberGroupById(Integer id)
    {
        return docMemberGroupMapper.deleteDocMemberGroupById(id);
    }
}
